﻿<?php
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require('include/functions.php');
define('SCRIPT','ad_list');
$infoid=$_GET['id'];
if(!$_COOKIE['userid']){
	echo "<script type='text/javascript'>location.href='mlogin.php';</script>";
	exit;
}
$sql = "select * from tbl_taorder where id='".$infoid."'";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);

$sql2="select * from tbl_taospp where id='".$row['goodid']."'";
$query2=mysql_query($sql2);
$row2=mysql_fetch_array($query2);


$sql3="select * from tbl_address where moren=1 and userid='".$row2['ggunit']."'";
$query3=mysql_query($sql3);
$row3=mysql_fetch_array($query3);


?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>还货单-众晒网</title>
    <link href="/ui/css/Hui.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
     #header{width:100%; position:absolute; top:0;}
     #footer{width:100%; height:55px; position:absolute; bottom:0;}	 
     #main{width:100%; overflow: auto; position:absolute; top:45px;bottom:0px;}
     table{background-color:white;margin:10px;width: 95%;}
    </style>
    <script src="/ui/js/jquery-1.9.1.min.js"></script>
</head>
<body>
    <header class="H-header H-theme-background-color-white" id="header">
        <span tapmode="" onclick="H.closeWin();" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-theme-font-color-white H-padding-horizontal-left-10 H-z-index-100"><i class="H-iconfont H-icon-arrow-left H-theme-font-color-black H-font-size-18 H-vertical-middle"></i></span>
        <div class="H-header-title H-center-all H-font-size-18 H-text-show-row-1 H-theme-font-color-black H-position-absolute H-width-100-percent H-font-weight-500">还货单</div>
    </header>

    <div id="main">
	 <div class="H-padding-vertical-bottom-10"></div>
     
     <div >
        <div class="H-flexbox-horizontal ">

            <div class="H-border-vertical-both-after" style="width:96%;margin:7px;background-color:white">
                <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
                    <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">商品名:</span><span 
                      class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-15 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12"><?php echo $row2['chtitle'] ?></span>
                </div>
                <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
                    <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">卖家昵称:</span><span 
                      class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-15 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12"><?php echo $row3['name'] ?></span>
                </div>                
                <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
                    <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">卖家号码:</span><span  class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-15 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12"/><?php echo $row3['tell'] ?></span>
                </div>
                 <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
                    <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">卖家地址:</span><span  class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-15 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12"/><?php echo $row3['dizhi'] ?></span>
                </div>



                <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
                    <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">物流单号:</span><input type="text"  name="delivery_bn"  id="delivery_bn" placeholder="请输入物流单号" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-15 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12"/>
                </div> 
				
                <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
                    <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">物流公司:</span>
					
					<span class="H-font-size-14 H-flex-item  H-center-all H-theme-font-color9 H-border-horizontal-right-after"><label class="H-display-inline-block H-vertical-middle"> 
				    <select name="fenlei"  id="sheng" style="width=25%" >

                    <option value ="ems">EMS</option>   
					
                    <option value ="zto">中通速递</option>
                 
                    <option value ="sto">申通速递</option>
                 
                    <option value ="yto">圆通速递</option>
                 
                    <option value ="yt">韵达速递</option>
                 
                    <option value ="sf">顺丰物流</option>
                 
                    <option value ="tt">天天物流</option>

                    </select></label></span>

					
					
					
                </div>  
        		     <div style="margin-top:20px">
                        <center>
                        <button onclick="go()" class="H-button H-width-100-percent H-padding-vertical-both-8 H-font-size-18 H-outline-none H-padding-horizontal-both-17 H-theme-background-color8 H-theme-font-color-white H-theme-border-color8 H-theme-border-color8-click H-theme-background-color8-click H-theme-font-color8-click H-border-radius-3" style="width:70%">确认提交</button>
                        </center>
                    </div>
	
                <div class="Validform_checktip"></div>
            </div>
        </div>
    </div>

	
	

          		
    </div>

     <!--################################底部开始################################-->  	

     <!--################################底部结束################################-->
	     <script src="/ui/js/jquery-1.9.1.min.js"></script>
    <script src="/ui/script/H.js" type="text/javascript"></script>
	    <script type="text/javascript" src="/ui/layer/mobile/layer.js"></script> 
	<script type="text/javascript">

	       function  go(){
	     var uid='<?=$_COOKIE['userid']?>';	
		 
		var codeid='<?=$_GET['id']?>';
		
		var refund_delivery_bn=$("#delivery_bn").val();

		console.log(refund_delivery_bn);		
		console.log(codeid);	
		
		
			if(refund_delivery_bn==""){
		
	layer.open({
    content: '请输入快递单号'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });	
	return false;	
	}

	   $.ajax({
        url: '/api/muyin/api.php?s=user.save_refund_delivery',
        type: 'POST',
        dataType: 'json',
        data: {
			uid:uid,
			oid:codeid,
			refund_delivery_bn:refund_delivery_bn
		},
      })
      .done(function(respon) {
        if (respon.code==0) {
	
layer.open({
  content: '发货成功',
  btn: '我知道了',
  shadeClose: false,
  yes: function(){
window.location.href = document.referrer;
   layer.close(index);
  }
});
      
        }else{
            
        
        }
      })	
	
		   }
</script>	
</body>
</html>